# -*- coding: utf-8 -*-

colorNameMap = {
    'red': '红色',
    'blue': '蓝色',
    'green': '绿色',
    'yellow': '黄色',
    'white': '白色',
    'black': '黑色',
    'grey': '灰色',
    'orange': '橙色',
    'brown': '棕色',
    'fluorescence': '萤光',
    'yellow-green': '黄绿色'
}

if __name__ == '__main__':
    import sys
    file = open(sys.argv[1], 'r', encoding='utf-8')
    lines = file.readlines()
    file_zh = open(sys.argv[1].replace('.conf', '') + '_zh.conf', 'w', encoding='utf-8')
    for line in lines:
        for key in colorNameMap:
            if key in line:
                line = line.replace(key, colorNameMap[key])
        file_zh.write(line)
    
